
                                    
                                        
                                       

                                      
                             EADME     ILE



T A B L E  O F  C O N T E N T S
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-

Introduction
System Requirements
Use of WINS2
Warranty, License




I N T R O D U C T I O N
-*-*-*-*-*-*-*-*-*-*-*-

I created this program to make an easy way to program DOS-based
applications with a MS-Windows look.  It began as a somewhat futile
effort to put forth some competition to Bill Gates.  Maybe it will
spur someone else on to do a bigger, better project which will actually
compare with MS-Windows.

This program is used to create a Windows look in Turbo/Borland C programs
by using commands similar to the standard ones used in Windows programming.
There are functions to create new windows, place objects, and automatically
operate the whole "world" of multiple windows.  Objects available are:

Push Button
Text Box
Chexk Box
Option Button
Group Box
Text Caption

The active and inactive window colors can also be changed.  In this
version, only one font is available.


Files included with this version:

SVGA256.BGI   - The BGI graphics file for using SVGA grphics modes
WINSDEMO.C    - A demo program for using WINS2
LITT.CHR      - The small font used for all the text
FILE_ID.DIZ   - A short description of this program
MOUSE.H       - An include file with mouse routines
WINS.H        - * THE GRAPHICS WINDOWS ENGINE *
README.TXT    - This instruction file




S Y S T E M  R E Q U I R M E N T S
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

DOS 5 or later
A 80386 or better CPU
4 MB RAM
A C compiler which supports BGI Graphics
SVGA 640x480x256
Mouse



U S E  O F  W I N S 2
-*-*-*-*-*-*-*-*-*-*-

One of the best ways of learning is to look at an example, then copy
it.  For this reason, I have included a demonstration program called
WINSDEMO.C which can be run in most any C compiler which supports BGI
graphics.

WINS2 can be used to do many simple jobs such as startup menus or
game configuration setups.  It starts getting hairy when used for
complex games or art studios.

--

The important commands are

void newwin(number, "Title", left edge, top edge, width, height);
void setobj(winnum, type, number, "Text", left edge, top edge, state);
void setobj2(winnum, type, number, "Text", left, top, width, height);
int  world();
int  state(int objnum);
char *text(int objnum);

newwin is used to create a new window
setobj is used to create buttons, check boxes, etc.
setobj2 is used for one-state objects (group-boxes)
world is used to automatically handle everything until a button is pushed


 *-* NEWWIN *-*
   number    - an arbitrary number used afterward to designate objects
               to that window
   "Title"   - a string variable or text in quotes printed in the title
               bar of the window
   top edge  - the initial location, in pixels, of the top of the window
   left edge - the initial location, in pixels, of the left of the window
   width     - the width of the window in pixels
   height    - the height of the window in pixels

   NOTES --  Once you have created a window with newwin(), it is there for
      the duration of the program.  There is no way to get rid of it.  In
      this version of WINS, none of the options specified by newwin() can
      be changed afterwards during the program's runtime.

 *-* SETOBJ & SETOBJ 2 *-*
   winnum    - the number of the window to assign this object to
   type      - A four-letter, all-CAPS abbreviation for the type of object
               to be used:
                     PUSH > Push button    \
                     OPTN > Option button  |
                     CHCK > Check box      >-  setobj()
                     TXTB > Text box       |
                     LABL > Text caption   /

                     GRPB > Group box      >-  setobj2()
  number     - The number to be assigned to the object
                    setobj():
                        0-9: Option buttons (group 1)
                      10-19: Option buttons (group 2)
                      20-29: Option buttons (group 3)
                      30-39: Option buttons (group 4)
                     40-119: All other setobj() objects

                    setobj2():
                       0-29: Group boxes
  "Text"     - A string variable or text in "quotes" to be displayed
               on/with the object
  top edge   - The distance from the top edge of the object to the
               top of the window
  left edge  - the distance from the left edge of the object to the
               left side of the window

 - setobj() only -
  state      - The state of the object:
                    SET        (pushed, checked, etc)
                    RESET      (unpushed, blank, etc)
                    GRAY_SET   (SET and grayed [unchangeable])
                    GRAY_RESET (RESET and grayed)

               With TEXT BOXES (TXTB), 'state' is the width of the
               text box in pixels.

               With TEXT CAPTIONS (LABL), 'state' is the color attribute
               to use for the caption (32=BLUE, 40=RED, 2=GREEN). The
               palette used is the standard default 256-color palette.

 - setobj2() only -
  width      - the width of the object in pixels
  height     - the height of the object in pixels

  NOTES --  If this is a bit confusing, study the example.  That makes it
     easier.

 *-* WORLD *-*
  This function takes no parameters.  It simply takes care of the whole
  environment until a button is pushed.  It returns an integer of the
  object number of the button pushed.

 *-* STATE *-*
  This returns the state of an object (SET, RESET, etc)

 *-* TEXT *-*
  This returns the text caption of an object.  Use for textboxes,
  to determine what is typed in them.

  Here's an example of these functions:

 int a;

 newwin(10,"Test Window",250,100,140,120);
 setobj(10,OPTN,0,"Option 1",50,40,SET);
 setobj(10,OPTN,1,"Option 2",50,60,RESET);
 setobj2(10,GRPB,0,"Options",40,20,60,40);
 setobj(10,PUSH,40,"Close",70,100,RESET);
 setobj(10,TXTB,41,"Text1",40,70,50);
 a=world();   // Only one button; a will always equal 40.
 if (state(0)==SET);  // "Option 1" selected
 if (state(1)==SET);  // "Option 2" selected
 if (text(41)=="Hi"); // "Hi" was typed in text box.

  Before beginning, use inits(x); to enter SVGA graphics mode.
   0= 320x200x256 VGA
   1= 640x400x256 SVGA
   2= 640x480x256 SVGA
   3= 800x600x256 SVGA
   4= 1024x768x256 SVGA

  Use closegraph(); to leave graphics mode at the conclusion of your
  programs.

  To change the active, inactive colors, change the values #defined as
  ACTIVEC and INACTIVEC.  The default is 2 (green) for ACTIVEC and 4
  (dark red) as INACTIVEC.  WINS2 uses color 16 for black, so you can
  use a setrgbpalette(0,r,g,b) to set the red, green, blue factors of the
  background color.  Just remember to use 16 for the color of black
  text captions, or the caption will be the same color as the background!

  GOOD LUCK!
  


W A R R A N T Y ,  L I C E N S E
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

This product comes with no warranty, express or implied, of any sort.  Use
this product at your own risk.

You (User) are hereby licensed to use, modify, duplicate, and distrubute
this product however you (User) wish.  However, once any modification
takes place, the modified object is no longer part of this product (WINS2),
but is a new object belonging entirely to the modifier.  The modifier then
assumes full responsibility for his new product.

In other words, once you (User) change it, it becomes your own code.


This product (WINS2) is Freeware.  No registration is required.  Please
send questions, comments, or bug reports to:

Jason Rowberg:  CompuServe: 74114,1214
                INTERNET:   74114.1214@compuserve.com

  Thank you for using this product.
